package com.school.graduation.goods.presenter;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;

import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.school.graduation.R;
import com.school.graduation.goods.view.FoundGoodDetailsActivityNew;


public class FoundGoodPresenter{
    private Context context;

    public FoundGoodPresenter(Context context) {
        this.context = context;
    }

    public void queryDateFromDate(String date) {
        Bundle bundle = new Bundle();
        bundle.putString("item",date);
        bundle.putBoolean("hot",false);
        FoundGoodDetailsActivityNew.toDetail(context,bundle);
    }

    public void showToastDialog() {
        new MaterialDialog.Builder(context)
                .content("确定清空历史搜索吗？")
                .positiveText("确定")
                .positiveColor(context.getResources().getColor(R.color.md_light_blue_300))
                .negativeText("取消")
                .negativeColor(context.getResources().getColor(R.color.md_grey_400))
                .canceledOnTouchOutside(false)
                .onPositive(new MaterialDialog.SingleButtonCallback() {
                    @Override
                    public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                    }
                })
                .build()
                .show();
    }
}
